package weak_20241227_29.stream;

import java.util.Arrays;

/**
 * @author zdl
 * @date 2024/12/28
 */
public class Demo24 {
    public static void main(String[] args) {
        //24. 删除字符串中所有的指定字符。
        String str = "what is your name";
        char delChar = 'a';
       /* char[] charArray = str.toCharArray();
        StringBuilder sb = new StringBuilder();
        for (char c : charArray) {
            if(c != delChar){
                sb.append(c);
            }
        }
        System.out.println(sb);*/
        str.chars().mapToObj(s -> (char)s).filter(s -> s != delChar).forEach(s -> System.out.print(s));
    }
}
